local skill = fk.CreateSkill {
  name = "hanqing__meteoric_rise_skill",
}

Fk:loadTranslationTable{
  ["hanqing__meteoric_rise_skill"] = "平步青云",
  ["#hanqing__meteoric_rise_skill"] = "选择一名角色，将此牌置于其判定区内。其判定阶段判定：<br/>"..
  "若结果不为♠，其加1点体力上限并回复1点体力",
}

skill:addEffect("cardskill", {
  prompt = "#hanqing__meteoric_rise_skill",
  mod_target_filter = Util.TrueFunc,
  target_filter = Util.CardTargetFilter,
  target_num = 1,
  on_effect = function(self, room, effect)
    local to = effect.to
    local judge = {
      who = to,
      reason = "hanqing__meteoric_rise",
      pattern = ".|.|heart,club,diamond",
    }
    room:judge(judge)
    if judge:matchPattern() and not to.dead then
      room:changeMaxHp(to, 1)
      if not to.dead then
        room:recover{
          who = to,
          num = 1,
          recoverBy = to,
          skillName = skill.name,
        }
      end
    end
    self:onNullified(room, effect)
  end,
  on_nullified = function(self, room, effect)
    room:moveCards{
      ids = room:getSubcardsByRule(effect.card, { Card.Processing }),
      toArea = Card.DiscardPile,
      moveReason = fk.ReasonUse,
    }
  end,
})

skill:addAI(nil, "__card_skill")

return skill
